import request from "../request";

// 获取所有角色信息
export const getRolesApi = (): PromiseRes<RoleObjItf[]> => request.get('/role/listAll')

// 分页获取角色数据
export const getRolesQueryPageApi = (data: RoleQueryPageParams): PromiseRes<QueryPageObjItf<RoleInfoObjItf>> => request.get('/role/list', {params: data})

// 获取角色的菜单信息
export const getRoleMenusByRoleIdApi = (roleId: number): PromiseRes<MenuListItf[]> => request.get(`/role/listMenu/${roleId}`)

// 更新角色菜单信息
export const allocMenuApi = (data: RoleMenusItf): PromiseRes => request.post(`/role/allocMenu?roleId=${data.roleId}&menuIds=${data.menuIds}`)
